package com.eyas.im.client.nio;

import com.eyas.im.client.ClientConfiguration;

public class NioClientConfiguration extends ClientConfiguration {
    private long selectorBlockTime = 1000L; //selector.select的阻塞时长，默认1S
    private int bufferCapacity = 1024;//readbuffer和writebuffer的容量，默认1kb

    /*用于检测并处理java nio在linux下的空轮询bug*/
    private boolean nioBugChecker = true; //是否启动NIO检测，默认启动
    private long nioBugIntervalThreshold = 100L;//两次selector之间，间隔时间小于该值时，被判定可能触发了bug
    private int nioBugPossibleCount = 50;//当被判定可能触发了bug的连续次数超过该值时，就判定确实发生了bug

    public long getSelectorBlockTime() {
        return selectorBlockTime;
    }

    public void setSelectorBlockTime(long selectorBlockTime) {
        this.selectorBlockTime = selectorBlockTime;
    }

    public boolean isNioBugChecker() {
        return nioBugChecker;
    }

    public void setNioBugChecker(boolean nioBugChecker) {
        this.nioBugChecker = nioBugChecker;
    }

    public long getNioBugIntervalThreshold() {
        return nioBugIntervalThreshold;
    }

    public void setNioBugIntervalThreshold(long nioBugIntervalThreshold) {
        this.nioBugIntervalThreshold = nioBugIntervalThreshold;
    }

    public int getNioBugPossibleCount() {
        return nioBugPossibleCount;
    }

    public void setNioBugPossibleCount(int nioBugPossibleCount) {
        this.nioBugPossibleCount = nioBugPossibleCount;
    }

    public int getBufferCapacity() {
        return bufferCapacity;
    }

    public void setBufferCapacity(int bufferCapacity) {
        this.bufferCapacity = bufferCapacity;
    }
}
